//
//  GLTollStationDataCell.m
//  Runone
//
//  Created by ekkaLyn on 2017/4/20.
//  Copyright © 2017年 runone. All rights reserved.
//

#import "GLTollStationDataCell.h"
#import "CommonUtilityjudge.h"

@interface GLTollStationDataCell ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftConstraintCharge;


@end

@implementation GLTollStationDataCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Initialization code
    if (iPhone5) {
        self.leftConstraintCharge.constant = -10;
        self.arrowImgV.hidden = YES;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setIsShowRightArrow:(BOOL)isShowRightArrow {
    self.arrowImgV.hidden = !_isShowRightArrow;
}

-(void)prepareForReuse {
    [super prepareForReuse];
    if (iPhone5) {
        self.arrowImgV.hidden = YES;
    }else {
     self.arrowImgV.hidden = NO;
    }
   
}

- (void)setStationSumaryM:(TollStationChargeListModel *)stationSumaryM {
    _stationSumaryM = stationSumaryM;
    [self settUpNewData];
}

- (void) settUpNewData {
    self.stationNameL.text = _stationSumaryM.TollStationName;
    self.dateL.text       = [_stationSumaryM.ChargeDate substringWithRange:NSMakeRange(0, 10)];

//    NSString *chargeStr = [NSString stringWithFormat:@"%0.2f",_stationSumaryM.ChargeAmount];
//    if (chargeStr.length > 9) {
//        NSString *sixStr  = [chargeStr substringWithRange:NSMakeRange(0, 6)];
//        NSString *dotStr  = @"...";
//        NSString *showStr = [NSString stringWithFormat:@"%@%@",sixStr, dotStr];
//        self.totalChargeL.text = [NSString stringWithFormat:@"%@元",showStr];
//    }else {
//    self.totalChargeL.text = [NSString stringWithFormat:@"%@元",chargeStr];
//    }
//    NSString *vehicleStr = [NSString stringWithFormat:@"%d",_stationSumaryM.ExportTrafficFlow];
//    if (vehicleStr.length > 6) {
//        NSString *sixStr  = [vehicleStr substringWithRange:NSMakeRange(0, 6)];
//        NSString *dotStr  = @"...";
//        NSString *showStr = [NSString stringWithFormat:@"%@%@",sixStr, dotStr];
//       self.vehicleFlowL.text = [NSString stringWithFormat:@"%@车次",showStr];
//    }else {
//    self.vehicleFlowL.text = [NSString stringWithFormat:@"%@车次",vehicleStr];
//    }
self.vehicleFlowL.text = _stationSumaryM.ExportTrafficFlow;
    self.totalChargeL.text = _stationSumaryM.ChargeAmount;
    
}

@end
